package com.battleship.models;

import java.util.Vector;

public class Ship {

	private final int SIZE_DESTRUCTOR = 2;
	private final int SIZE_SUBMARINE = 3;
	private final int SIZE_CRUISER = 3;
	private final int SIZE_BATTLESHIP = 4;
	private final int SIZE_CARRIER = 5;
	
	private char type;
	private int size;
	private Vector<Coordinate> coordinates;
	private int [] posX;
	private int [] posY;
	
	
	public Ship(char type, int [] posX, int [] posY ){
		this.type = type;
		if(type == GameBoard.DESTRUCTOR){
			size = SIZE_DESTRUCTOR;
		}else if(type == GameBoard.SUBMARINE){
			size = SIZE_SUBMARINE;
		}else if(type == GameBoard.CRUISER){
			size = SIZE_CRUISER;
		}else if(type == GameBoard.BATTLESHIP){
			size = SIZE_BATTLESHIP;
		}else if(type == GameBoard.CARRIER){
			size = SIZE_CARRIER;
		}
		this.posX = posX;
		this.posY = posY;
		
	}
	
	public void setCoordinates(){
		for(int i = 0; i<size ; i++){
			coordinates.addElement(new Coordinate(posX[i], posY[i]));
		}
		
	}
	
	public Vector<Coordinate> getCoordinates(){
		return coordinates;
	}

	public char getType() {
		return type;
	}

	public void setType(char type) {
		this.type = type;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}
	
	
	
}


